-
Notifications
You must be signed in to change notification settings - Fork 364
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor package infrastructure/kubernetes #1259
Conversation
Codecov Report
@@ Coverage Diff @@
## main #1259 +/- ##
==========================================
+ Coverage 61.81% 62.03% +0.22%
==========================================
Files 85 76 -9
Lines 10854 10701 -153
==========================================
- Hits 6709 6638 -71
+ Misses 3700 3624 -76
+ Partials 445 439 -6
... and 2 files with indirect coverage changes Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
59ee7b3
to
0255bad
Compare
return nil | ||
} | ||
|
||
func (i *Instance) DeleteConfigMap(ctx context.Context, cm *corev1.ConfigMap) error { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: we can just pass the ns and name to delete a specific resource, or we can use a single function to delete all kinds of resources.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMO, this PR is too large to review, let's do more refactor later.
Applier
absolute can be more generic.
Signed-off-by: hejianpeng <[email protected]>
237fbc5
to
02b9e68
Compare
@qicz can you also help review this PR since you've done some refactoring in this area in the past, thanks in advance ! |
No problem. in fact, i have already reviewed a few days ago without.note, i will do this again. |
// expectedProxyDeployment returns the expected Deployment based on the provided infra. | ||
func (i *Infra) expectedProxyDeployment(infra *ir.Infra) (*appsv1.Deployment, error) { | ||
type ResourceRender struct { | ||
infra *ir.Infra |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
using ir.ProxyInfra
directly?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMO, it's too wide to use ProxyInfra
here for now, change it when necessary in the future.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
address follow up here: #1330 (comment)
Signed-off-by: hejianpeng <[email protected]>
Signed-off-by: hejianpeng <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, I will follow up for this refactor in another pr. issue #1330
refactor package to reuse code :
Applier
to create/update/delete Kubernetes resourcesResourceRender
to render resource forProxy
/RateLimit
utils
packagecc @arkodg